﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="PlugInInput.ascx.cs" Inherits="admin_webparts_Plug_in_PlugInInput" %>
<%@ Import Namespace="NTTHAO.Common.BL" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>

<script type="text/javascript">

NTTHAO.namespace('page');

NTTHAO.page.langText = [];
NTTHAO.page.langText['ERROR_MESSAGE'] = '<%=this._ErrorMessage %>';

</script>

<div class="tip">
	<h1><%=LanguageUtility.GetLanguageText("PLUGIN_EDIT", Session)%></h1>
</div>
<form id="PlugIn" runat="server">
<input type="hidden" id="txtPluginID" name="txtPluginID" value="" runat="server"/>
<p style="text-align: left;">
    <span id="spSave" class="yui-button yui-link-button yuibtn yuibtn-icon btnsave"><span class="first-child"><asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Save" /></span></span>
    <span id="spCancel1" class="yui-button yui-link-button yuibtn yuibtn-icon btncancel"><span class="first-child"><input id="btnCancel1" type="button" value="<%=LanguageUtility.GetLanguageText("CANCEL", Session)%>" onclick="javscript: location.href='?type=plug_in&action=list';" /></span></span>
</p>
<table cellspacing="0" cellpadding="0" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("NAME", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtName" runat="server" Width="250px" CausesValidation="True"></asp:TextBox>
            <span id="txtNameValidator" style="color:Red;">Vui lòng nhập tên plug-in</span>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("PLUGIN_URL_NAME", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtUrlName" runat="server" Width="250px" CausesValidation="True"></asp:TextBox>
            </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("PLUGIN_ADMIN_FILE_URL", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtAdminFileURL" runat="server" Width="250px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("PLUGIN_UI_FILE_URL", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtUIFileURL" runat="server" Width="250px"></asp:TextBox>
        </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("PLUGIN_INSTALL_FILE_URL", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtInstallFileURL" runat="server" Width="250px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("DESCRIPTION", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtDescription" runat="server" Width="300px" Height="75px" Rows="5" TextMode="MultiLine"></asp:TextBox>
        </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:
        </td>
        <td>
            <input id="chkActive" type="checkbox" checked="checked" runat="server" />
        </td>
    </tr>
</table>
<p style="text-align: left;">
    <span id="spSave2" class="yui-button yui-link-button yuibtn yuibtn-icon btnsave"><span class="first-child"><asp:Button ID="btnSave2" runat="server" OnClick="btnSave_Click" Text="Save" /></span></span>
    <span id="spCancel2" class="yui-button yui-link-button yuibtn yuibtn-icon btncancel"><span class="first-child"><input id="btnCancel2" type="button" value="<%=LanguageUtility.GetLanguageText("CANCEL", Session)%>" onclick="javscript: location.href='?type=plug_in&action=list';" /></span></span>
</p>

<script type="text/javascript"> 
YAHOO.util.Event.onContentReady("spCancel1", function () {
    var spCancel1 = new YAHOO.widget.Button("spCancel1");
    spCancel1.on("click", function () {location.href='?type=plug_in&action=list';}); 
});
YAHOO.util.Event.onContentReady("spCancel2", function () {
    var spCancel2 = new YAHOO.widget.Button("spCancel2");
    spCancel2.on("click", function () {location.href='?type=plug_in&action=list';}); 
});
YAHOO.util.Event.onContentReady("spSave", function () {
    var spSave = new YAHOO.widget.Button("spSave");
});
YAHOO.util.Event.onContentReady("spSave2", function () {
    var btnSave2 = new YAHOO.widget.Button("spSave2");
});
YAHOO.util.Event.onDOMReady(function() {
    if(document.getElementById("<%=txtPluginID.ClientID %>").value == "") {
        document.getElementById("<%=txtName.ClientID %>").value = "";
        document.getElementById("<%=txtUrlName.ClientID %>").value = "";
        document.getElementById("<%=txtAdminFileURL.ClientID %>").value = "";
        document.getElementById("<%=txtUIFileURL.ClientID %>").value = "";
        document.getElementById("<%=txtInstallFileURL.ClientID %>").value = "";
        document.getElementById("<%=txtDescription.ClientID %>").value = "";
        document.getElementById("<%=chkActive.ClientID %>").checked = false;
    }
    document.getElementById("<%=txtName.ClientID %>").focus();
    document.getElementById("<%=txtName.ClientID %>").select();
    
    NTTHAO.formValidator.validate(document.forms(0), "<%=txtName.ClientID %>", "txtNameValidator", NTTHAO.validator.noBlank);
});

if(NTTHAO.page.langText['ERROR_MESSAGE'] != '') {
    YAHOO.util.Event.onDOMReady(function() {
        alert(NTTHAO.page.langText['ERROR_MESSAGE']);
    });
}
</script>

</form>
<style type="text/css">
    #spCancel1, #spSave, #spCancel2, #spSave2 {font-size:1.1em; font-weight: bold; }
    #spCancel1 button, #spSave button, #spCancel2 button, #spSave2 button { font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold; }
</style>